package cn.kgc.wyttest.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author Chang
 * @program: wytTest
 * @description: 状态信息
 * @date 2022-10-17 10:44:36
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReturnResult implements Serializable {

    private static final long serialVersionUID = 7414679360735068478L;
    /**
     * 0000成功  0001失败
     */
    private String status;
    /**
     * 提示信息
     */
    private String msg;
    /**
     * 服务器返回值数据
     */
    private Object data;
    public static ReturnResult fail() {

        return new ReturnResult("0001", "业务调用失败!!", null);
    }

    public static ReturnResult success() {

        return new ReturnResult("0000", "业务调用成功!!", null);
    }


    public static ReturnResult success(Object data) {

        return new ReturnResult("0000", "业务调用成功!!", data);
    }

    public static ReturnResult success(String msg, Object data) {

        return new ReturnResult("0000", msg, data);
    }
}
